<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	pageContext.setAttribute("path", path);
	pageContext.setAttribute("basePath", basePath);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath %>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>家教信息</title>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="js/jquery.min.js"></script>
<!-- Custom Theme files -->
<!--theme-style-->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />	
<!--//theme-style-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Wedding Store Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- start menu -->
<script src="js/simpleCart.min.js"> </script>
<!-- start menu -->
<link href="css/memenu.css" rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript" src="js/memenu.js"></script>
<script>$(document).ready(function(){$(".memenu").memenu();});</script>	
<!-- /start menu -->
<link href="css/form.css" rel="stylesheet" type="text/css" media="all" />
<link rel="stylesheet" href="css/flexslider.css" type="text/css" media="screen" />
<script defer src="js/jquery.flexslider.js"></script>
<script type="text/javascript">

	function buy(){
		var pat_identity_card = "${sessionScope.patriarch.pat_identity_card}";
		if (pat_identity_card != null && pat_identity_card != "") {
			var tea_price = $("#tea_price").val();
			var deal_time = $("#deal_time").val();
			if (deal_time > 0) {
				var t = confirm("总价格为:"+deal_time*tea_price+"。是否确认付款?")
				if (t) {
					$("#deal_money").val(deal_time*tea_price);
					document.getElementById("deal").submit();
				}
			}else{
				alert("请选择大于0个小时的时间！");
			}
			
		}else{
			alert("请先进行实名认证!");
		}
	}

</script>
</head>
<body> 
<!--header-->	
	<jsp:include page="../common/headerTeacher.jsp"></jsp:include>
<!---->
<div class="single-sec">
	 <div class="container">
		 <ol class="breadcrumb">
			  <jsp:include page="../common/first.jsp"></jsp:include>
			  <li class="active">家教信息</li>
	  	 </ol>
		 <!-- start content -->	
		 <div class="col-md-9 det" style="width:100%">
			<div class="single_left">
				 <div class="flexslider">
					 <img src="/upload/${teacher.tea_photo }" style="width: 400px; height: 400px"/>
				 </div>
				 </div>
				  <div class="single-right">
					 <h3>${teacher.tea_name }</h3>
					 <div class="item-list">
						 <ul>
							 <li>学校: ${teacher.tea_school }</li>
							 <li>专业: ${teacher.tea_major }</li>
							 <li>入学年份: ${teacher.tea_class }</li>
							 <li>价格: ${teacher.tea_price }元/小时</li>
							 <li>性别: ${teacher.tea_sex }</li>
							 <li>地址: ${teacher.province.province_name }-${teacher.city.city_name }-${teacher.area.area_name }-${teacher.tea_address }</li>
						 </ul>
					  </div>
					  <c:if test="${not empty sessionScope.patriarch }">
						  <div class="check">
								 <form class="navbar-form navbar-left" role="search" action="deal/addDeal" method="post" id="deal">
								 	  <input type="hidden" value="${teacher.tea_id }" name="tea_id">
								 	  <input type="hidden" value="${teacher.tea_price }" id="tea_price">
								 	  <input type="hidden" value="" id="deal_money" name="deal_money">
									  <div class="form-group">
										<input type="number" id="deal_time" name="deal_time" class="form-control" placeholder="小时数">
									  </div>
									  <button type="button" onclick="buy()" class="btn btn-default">选择</button>
								 </form>
						  </div>
					  </c:if>
					  <br/>
					  <div class="single-bottom1">
						<h6>备注</h6>
						<p class="prod-desc">${teacher.tea_remark }</p>
					 </div>					 
				  </div>
				  <div class="clearfix"></div>
					<div class="sofaset-info">
						 <h4>评价</h4>
						 <ul>
						 	 <c:choose>
						 	 	<c:when test="${not empty listDealByTeaId }">
							 	 	  <c:forEach items="${listDealByTeaId }" var="deal">
								 	 	  <li>家长评价：${deal.pat_evaluate }</li>
									 	  <li>&nbsp;&nbsp;&nbsp;&nbsp;家教回复：${deal.tea_evaluate }</li>
									 	  <br/>
							 	 	  </c:forEach>
						 	 	</c:when>
						 	 	<c:otherwise>
						 	 		<li>${message }</li>
						 	 	</c:otherwise>
						 	 </c:choose>
						 </ul>
						 <jsp:include page="../common/pages.jsp"></jsp:include>
				  </div>
		</div>
		<div class="clearfix"></div>
	</div>	 
</div>
<!---->
	<jsp:include page="../common/footer.jsp"></jsp:include>
</body>
</html>